/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package problems;

import java.util.ArrayList;
import objective_functions.ObjectiveFunction;
import mopso.Problem;
import objective_functions.ZDT4_F1;
import objective_functions.ZDT4_F2;

/**
 *
 * @author robson
 */
public class ZDT4 implements Problem {
    private ArrayList<ObjectiveFunction> functions;
    private int nFunctions;
    private int nDimensions;
    
    public ZDT4( ) {
        functions = new ArrayList<ObjectiveFunction>();
        
        functions.add( new ZDT4_F1() );
        functions.add( new ZDT4_F2() );
        
        nFunctions = functions.size();
        nDimensions = 10;
    }

    public ArrayList<ObjectiveFunction> getFunctions() {     
        return functions;
    }

    public int getNDimensions() {
        return nDimensions;
    }

    public int getNObjectives() {
        return nFunctions;
    }    
    
    public double getMaxBound( int dimension ) {
        if( dimension == 0 ) {
            return 1.0;            
        }
        
        else {
            return 5.0;
        }        
    }

    public double getMinBound( int dimension ) {
        if( dimension == 0 ) {
            return 0.0;            
        }
        
        else {
            return -5.0;
        }
    }

    public double getMaxInitValue( int dimension ) {
        if( dimension == 0 ) {
            return 1.0;            
        }
        
        else {
            return 5.0;
        }
    }

    public double getMinInitValue( int dimension ) {
        if( dimension == 0 ) {
            return 0.0;            
        }
        
        else {
            return -5.0;
        }
    }

    public double getGValue() {
        return (( ZDT4_F2 ) functions.get(1)).getGValue();
    }

    public String getName() {
        return "ZDT 4";
    }
}
